import request from "@/utils/request";

/**
 * 获取文档列表
 * @returns {Promise<any>}
 */
export async function fetchDocsList() {
  return request('/admin/docs?include=version')
}

/**
 * 获取文档目录
 * @param data
 * @returns {Promise<any>}
 */
export async function fetchCurrentDocs(data) {
  return request.post('/admin/summary',{data})
}

/**
 * 获取文章详情
 * @param id
 * @returns {Promise<any>}
 */
export async function getArticleDetail(id) {
  return request(`/admin/summary/${id}`)
}

/**
 * 改变文档状态
 * @param data
 * @returns {Promise<any>}
 */
export async function switchDocs(data) {
  return request.put('/admin/status',{data})
}

/**
 * 删除文档
 * @param data
 * @returns {Promise<RequestResponse<any>>}
 */
export async function deleteDocs(data) {
  return request.delete('/admin/deldocs',{data})
}



